<html>
<head><meta charset="utf-8"><title>str UB change · t-lang/doc · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/index.html">t-lang/doc</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/str.20UB.20change.html">str UB change</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="197172159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/str%20UB%20change/near/197172159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/str.20UB.20change.html#197172159">(May 11 2020 at 16:38)</a>:</h4>
<p>So who could review <a href="https://github.com/rust-lang/reference/pull/792">https://github.com/rust-lang/reference/pull/792</a> ? :D</p>



<a name="197184999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/str%20UB%20change/near/197184999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/str.20UB.20change.html#197184999">(May 11 2020 at 18:22)</a>:</h4>
<p>Looks like it landed, though there may have been a race condition with <span class="user-mention" data-user-id="120518">@Eric Huss</span>'s <a href="https://github.com/rust-lang/reference/pull/792#issuecomment-626867680">comment</a></p>



<a name="197246306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/str%20UB%20change/near/197246306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> isHavvy <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/str.20UB.20change.html#197246306">(May 12 2020 at 08:31)</a>:</h4>
<p><span class="user-mention" data-user-id="120791">@RalfJ</span> re: <a href="https://github.com/rust-lang/reference/pull/809">https://github.com/rust-lang/reference/pull/809</a></p>
<p>Wouldn't it make sense to write the compiler/core spec definition of <code>str</code> first and then point out that it has a library invariant that they be valid utf-8 codepoints afterwards?</p>
<p>It's definitely muddied describing with the minimalist change you have.</p>



<a name="197329619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/str%20UB%20change/near/197329619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/str.20UB.20change.html#197329619">(May 12 2020 at 19:55)</a>:</h4>
<p>I don't know what would be best. for most users, they should just uphold the library invariant always and the fact that it is "just" a library invariant does not matter much -- it might cause more confusion to mention that.</p>



<a name="197329673"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/str%20UB%20change/near/197329673" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/str.20UB.20change.html#197329673">(May 12 2020 at 19:56)</a>:</h4>
<p>really to properly describe this we need some solid terminology (like my validity/safety invariant, or maybe language/library invariant or whatever)</p>



<a name="197329712"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/237824-t-lang/doc/topic/str%20UB%20change/near/197329712" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/237824-t-lang/doc/topic/str.20UB.20change.html#197329712">(May 12 2020 at 19:56)</a>:</h4>
<p>until then I'm afraid it is going to be muddied, as things always are when there is no precise terminology in place ;)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>